package com.ruoyi.project.WebMoudle.shopPick.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.project.WebMoudle.shopPick.domain.PickSum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.WebMoudle.shopPick.mapper.ShopPickMapper;
import com.ruoyi.project.WebMoudle.shopPick.domain.ShopPick;
import com.ruoyi.project.WebMoudle.shopPick.service.IShopPickService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 商家提现Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-17
 */
@Service
public class ShopPickServiceImpl implements IShopPickService 
{
    @Autowired
    private ShopPickMapper shopPickMapper;

    /**
     * 查询商家提现
     * 
     * @param orderNum 商家提现ID
     * @return 商家提现
     */
    @Override
    public ShopPick selectShopPickById(String orderNum)
    {
        return shopPickMapper.selectShopPickById(orderNum);
    }

    /**
     * 查询商家提现列表
     * 
     * @param shopPick 商家提现
     * @return 商家提现
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ShopPick> selectShopPickList(ShopPick shopPick)
    {
        return shopPickMapper.selectShopPickList(shopPick);
    }

    /**
     * 新增商家提现
     * 
     * @param shopPick 商家提现
     * @return 结果
     */
    @Override
    public int insertShopPick(ShopPick shopPick)
    {
        shopPick.setCreateTime(DateUtils.getNowDate());
        return shopPickMapper.insertShopPick(shopPick);
    }

    /**
     * 修改商家提现
     * 
     * @param shopPick 商家提现
     * @return 结果
     */
    @Override
    public int updateShopPick(ShopPick shopPick)
    {
        return shopPickMapper.updateShopPick(shopPick);
    }

    /**
     * 删除商家提现对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShopPickByIds(String ids)
    {
        return shopPickMapper.deleteShopPickByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商家提现信息
     * 
     * @param orderNum 商家提现ID
     * @return 结果
     */
    @Override
    public int deleteShopPickById(String orderNum)
    {
        return shopPickMapper.deleteShopPickById(orderNum);
    }

    @Override
    public List<ShopPick> queryMonthLog(Long shopId, String month) {
        return shopPickMapper.queryMonthLog(shopId,month);
    }

    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public PickSum queryMoneySum(ShopPick shopPick) {
        return shopPickMapper.queryMoneySum(shopPick);
    }
}
